package ui.actions;

import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;

import javax.swing.AbstractAction;
import javax.swing.KeyStroke;

import ui.Main;
import util.Util;

/**
 * Action for Save.
 * @author TKington
 *
 */
public class SaveAction extends AbstractAction {
	/**
	 * Creates a new SaveAction.
	 */
	public SaveAction() {
		putValue(NAME, "Save");
		putValue(SHORT_DESCRIPTION, "Save File");
		putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
		putValue(SMALL_ICON, Util.getIcon("Save16.gif")); //$NON-NLS-1$
	}

	public void actionPerformed(ActionEvent evt) {
        Main.frame.onSaveFile();
	}
}
